$(function(){
//	修改登录密码
var prevent_repetition=true;
	$(".register_btn").on("click",function(){
		if(prevent_repetition){
			prevent_repetition=false;
			var oldpwd=$(".oldpwd").val();
			var newpwd=$(".newpwd").val();
			var qr_newpwd=$(".qr_newpwd").val();
			if(!oldpwd){
				layer.msg("请输入原密码");
				prevent_repetition=true;
				return false;
			}
			if(!newpwd){
				layer.msg("请输入新密码");
				prevent_repetition=true;
				return false;
			}
			if(!qr_newpwd){
				layer.msg("请再次输入新密码");
				prevent_repetition=true;
				return false;
			}
			if(newpwd != qr_newpwd){
				layer.msg("两次密码输入不一致");
				prevent_repetition=true;
				return false;
			}
			var d={};
			d.oldpwd=oldpwd;
			d.token=token;
			d.newpwd=newpwd;
			d.qr_newpwd=qr_newpwd;
			$.ajax({
			    type:"post",
			    url:url+'/user/alterlogpwd.html?token='+token,
			    async:false,
			    data:d,
			    dataType:'json',
			    success:function(result){
			        if(result.status == "0001"){
			        	layer.msg(result.message);
			        	location.href='my_information1.html';
			        }else{
			            isErr(result);
			        }
			    },
				error:function(){
					layer.msg("响应失败");
				},
				complete: function() {
					prevent_repetition = true;
				}
			})
		}
	})
})
